package com.kaisu.blog.infrastructure.user;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Getter
@Setter
@Entity
@ToString
@DynamicInsert
@DynamicUpdate
@Table(name = "`follow`")
public class FollowPO {
    /**
     * id
     */
    @Id
    private Long id;
    /**
     * 表示关注该用户的用户
     */
    @ManyToOne
    @JoinColumn(name = "follower_id")
    private UserPO follower;
    /**
     * 表示该用户关注的用户
     */
    @ManyToOne
    @JoinColumn(name = "following_id")
    private UserPO following;
}